#pragma once

// CCalibData command target

#include "cvxImage.h"
#include <vector>
#include "CCamera.h"
#include "cvxBoard.h"

class CmanualCalibDoc;


class CCalibData : public CObject
{
	friend class CmanualCalibDoc;

public:
	CCalibData();
	virtual ~CCalibData();

public:
	bool addImage(const string & fileName);
	bool addImage(IplImage *img, CvxBoard *board);
	void addCorner(const Point2f &p);
	void deleteLastCorner();
	void deleteAllCorners(){m_cornerVec.resize(0);}
	bool finishAddCorner(void){return m_cornerVec.size() == 4;}
	void Draw(CDC *pDc, float ratio);
	void DrawPredictedPts(CDC *pDc, float ratio, vector<Point2f> &pts);
	IplImage *GetImage(void){return m_img;}
	bool GetInsiderCorner(vector<Point2f> &pts, bool subPixel);
	//bool removeCornerTail(void){m_cornerList.RemoveTail()}

public:

private:
	IplImage *m_img;
	IplImage *m_grayImg;
	vector<Point2f> m_cornerVec;
	CvxBoard *m_pBoard;   //can't release itself

};


